//
//  ManTicketCell.swift
//  ManGuangDB
//
//  Created by 李东 on 2024/3/27.
//

import UIKit

class ManTicketCell: UITableViewCell {
    
    
    @IBOutlet weak var dateTimeLabel: UILabel!
    
    @IBOutlet weak var timrLabel: UILabel!
    @IBOutlet weak var bgView: UIView!
    
    @IBOutlet weak var picImgView: UIImageView!
    
    @IBOutlet weak var titlleLabel: UILabel!
    
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        bgView.layer.cornerRadius = 15
        bgView.layer.masksToBounds = true
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    var model: ManTicketModel! {
        didSet {
            picImgView.image = UIImage(contentsOfFile: CompressedHelper.shared.getFilePath(fileName: model.fileName))
            titlleLabel.text = model.title
            let str = ManDataHelper.shared.df.string(from: Date(timeIntervalSince1970: TimeInterval(model.ts)))
            let list = str.components(separatedBy: "\n")
            dateTimeLabel.text = list[0]
            timrLabel.text = list[1]
        }
    }
    
}
